import java.awt.*;
import javax.swing.*;

public class EastPanel extends JPanel
{
	private JTextField _txtFieldName, _txtFieldAge;
	private ButtonAddPerson _butAddPerson;
	private ButtonMovePerson _butMovePerson;
	private JRadioButton[] _rbQueue;
	private ButtonGroup g = new ButtonGroup();
	
	public EastPanel(Store _store, JList _liOfCu)
	{
		super();
		_txtFieldName = new JTextField();
		_txtFieldAge = new JTextField();
		
		_rbQueue = new JRadioButton[9];
		
		_butAddPerson = new ButtonAddPerson(_txtFieldName, _txtFieldAge, _store);
		_butMovePerson = new ButtonMovePerson(_store, _rbQueue, _liOfCu);
		
		_txtFieldName.setColumns(10);
		_txtFieldAge.setColumns(10);

		
		
		for(int i=0; i<8; i++)
		{
			_rbQueue[i] = new JRadioButton(""+(i+1), false);
			g.add(_rbQueue[i]);
		}

		g.add(_rbQueue[8]=new JRadioButton("Shortest", false));
		
		_rbQueue[0].setSelected(true);
		
		this.setPreferredSize(new Dimension(130,100));
		this.add(new JLabel("Name"));
		this.add(_txtFieldName);
		this.add(new JLabel("Age"));
		this.add(_txtFieldAge);
		this.add(_butAddPerson);
		this.add(new JLabel("                   "));
		this.add(_butMovePerson);
		
		for(int i=0; i<9; i++)
		{
			this.add(_rbQueue[i]);
		}
	}
}
